package org.student.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.student.Iservice.IStudentService;
import org.student.entity.Student;
import org.student.service.impl.StudentServiceimpl;


public class QueryAllStudent extends HttpServlet {	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		IStudentService   studentservice = new StudentServiceimpl();
		ArrayList<Student> students  =  (ArrayList<Student>)studentservice.queryallstudent();
		 request.setAttribute("students",students);
		 request.getRequestDispatcher("StudentsAdmin.jsp").forward(request, response);;
		 
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	     this.doGet(request, response);
	}

}
